/**
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.yonsei.iwb.sdt.refinement;

import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;
import java.util.Vector;
import org.yonsei.iwb.sdt.ontology.PropertyArc;

/**
 *
 * @author JDK
 */
public class ExpandingHistory{
    private Vector<PropertyArc> propertySet = new Vector<PropertyArc>();
    private Vector<String> quantifier = new Vector<String>();
    private Vector<Resource> instanceSet = new Vector<Resource>();
    
    public void add(PropertyArc property, String quantifier){
        this.propertySet.add(property);
        this.quantifier.add(quantifier);
    }
    
    public boolean contains(Resource r){
        return this.instanceSet.contains(r);
    }
    
    public void addInstance(Resource r){
        if(!this.instanceSet.contains(r)){
            this.instanceSet.add(r);
            
        }
        
    }
    
    public Vector<Resource> getInstanceSet(){
        return this.instanceSet;
    }
    
    public Vector<PropertyArc> getPropertySet(){
        return this.propertySet;
    }
    
    public Vector<String> getQuantifierSet(){
        return this.quantifier;
    }
    
    public void updateExpandingHistory(ExpandingHistory eh){
        
        for (int i = 0; i < eh.getPropertySet().size(); i++) {
            this.propertySet.add(eh.getPropertySet().get(i));            
        }

        for (int i = 0; i < eh.getQuantifierSet().size(); i++) {
            this.quantifier.add(eh.getQuantifierSet().get(i));            
        }
                
    }
    
    public int getExpandingHistorySize(){
        return this.propertySet.size();
    }
    
    public boolean isEmpty(){
        return this.propertySet.isEmpty();
    }
}
